#pragma once

#include "topcvt_unpack.hpp"
#include "delim_helper.hpp"

namespace topcvt
{
	class DelimUnpack : public UnpackImp
	{
		ByteBuffer m_backup;
	public:
		DelimUnpack(ByteBuffer& message)
			: UnpackImp(message)
		{}

		void checkElementCfgValid(AttributeableCfg& t) override;
		PolicyContext& unpackPolicy(PolicyContext& ctx, PolicyCfg& f) override;
		string unpackField(pugi::xml_node& node, FieldCfg& f, PolicyContext& ctx) override;
		void unpackLoop(pugi::xml_node& node, LoopCfg& f, PolicyContext& ctx) override;

		void check(AttributeableCfg& t);
	};
};